
[#macro orderformUpdateView]
    <div class="model-form">
        <el-page-header @back="goBack" content="更新订单">
        </el-page-header>
        <div class="model-content">
            <el-form ref="ruleForm" :rules="rules" :model="form" label-width="160px" >
                <el-row :gutter="10">
 <el-col :span="12">
     <el-form-item label="商家" size="mini" prop="shop">
             <el-select style="width: 100%;"  v-model="form.shop" filterable clearable
                     placeholder="请选择">
                 <el-option v-for="item in shopOptions" :key="item.id"
                         :label="item.name" :value="item.id">
                 </el-option>
             </el-select>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="订单号" size="mini" prop="no">
             <el-input v-model="form.no" name="no">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="合并支付订单号" size="mini" prop="mergeOrderCode">
             <el-input v-model="form.mergeOrderCode" name="mergeOrderCode">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="外部交易流水号" size="mini" prop="outTradeNum">
             <el-input v-model="form.outTradeNum" name="outTradeNum">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="订单来源" size="mini" prop="orderSource">
             <el-input v-model="form.orderSource" name="orderSource">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="支付来源" size="mini" prop="paySource">
             <el-input v-model="form.paySource" name="paySource">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="最新售后ID" size="mini" prop="newRefundId">
             <el-input v-model="form.newRefundId" name="newRefundId">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="订单状态" size="mini" prop="orderState">
             <el-input v-model="form.orderState" name="orderState">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="评价状态" size="mini" prop="commentState">
             <el-input v-model="form.commentState" name="commentState">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="用户删除" size="mini" prop="userState">
             <el-input v-model="form.userState" name="userState">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="下单时间" size="mini" prop="orderTime">
             <el-input v-model="form.orderTime" name="orderTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="支付时间" size="mini" prop="payTime">
             <el-input v-model="form.payTime" name="payTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="发货时间" size="mini" prop="deliveryTime">
             <el-input v-model="form.deliveryTime" name="deliveryTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="收货时间" size="mini" prop="receiveTime">
             <el-input v-model="form.receiveTime" name="receiveTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="订单类型" size="mini" prop="orderType">
             <el-input v-model="form.orderType" name="orderType">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="重量" size="mini" prop="weight">
             <el-input v-model="form.weight" name="weight">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="原价" size="mini" prop="totalAmount">
             <el-input v-model="form.totalAmount" name="totalAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="应付金额" size="mini" prop="amount">
             <el-input v-model="form.amount" name="amount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="整单折扣" size="mini" prop="changeAmount">
             <el-input v-model="form.changeAmount" name="changeAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="实际支付金额" size="mini" prop="payAmount">
             <el-input v-model="form.payAmount" name="payAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="运费" size="mini" prop="freight">
             <el-input v-model="form.freight" name="freight">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="卖家优惠券总金额" size="mini" prop="discount">
             <el-input v-model="form.discount" name="discount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="平台优惠券总金额" size="mini" prop="platformDiscount">
             <el-input v-model="form.platformDiscount" name="platformDiscount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="积分抵扣" size="mini" prop="integralDiscount">
             <el-input v-model="form.integralDiscount" name="integralDiscount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="使用积分数" size="mini" prop="useIntegral">
             <el-input v-model="form.useIntegral" name="useIntegral">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="使用红包" size="mini" prop="useRedPacket">
             <el-input v-model="form.useRedPacket" name="useRedPacket">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="单件商品红包抵扣" size="mini" prop="redPacketDiscount">
             <el-input v-model="form.redPacketDiscount" name="redPacketDiscount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="退款金额" size="mini" prop="returnAmount">
             <el-input v-model="form.returnAmount" name="returnAmount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="积分赠送" size="mini" prop="sendIntegral">
             <el-input v-model="form.sendIntegral" name="sendIntegral">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="系统自动收货时间" size="mini" prop="sysReceiveTime">
             <el-input v-model="form.sysReceiveTime" name="sysReceiveTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="是否已延长收货" size="mini" prop="hasExtendReceive">
             <el-input v-model="form.hasExtendReceive" name="hasExtendReceive">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="商家改价格时间" size="mini" prop="editPriceTime">
             <el-input v-model="form.editPriceTime" name="editPriceTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="完成时间" size="mini" prop="finishTime">
             <el-input v-model="form.finishTime" name="finishTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="购买数量" size="mini" prop="productCount">
             <el-input v-model="form.productCount" name="productCount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="退货数量" size="mini" prop="returnCount">
             <el-input v-model="form.returnCount" name="returnCount">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="最后提现时间" size="mini" prop="remindTime">
             <el-input v-model="form.remindTime" name="remindTime">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="收货人" size="mini" prop="consignee">
             <el-input v-model="form.consignee" name="consignee">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="联系电话" size="mini" prop="phone">
             <el-input v-model="form.phone" name="phone">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="收货地址" size="mini" prop="address">
             <el-input v-model="form.address" name="address">
             </el-input>
     </el-form-item>
      
 </el-col>
 <el-col :span="12">
     <el-form-item label="备注" size="mini" prop="note">
             <el-input v-model="form.note" name="note">
             </el-input>
     </el-form-item>
      
 </el-col>
                </el-row>
                <el-row>
                    <el-col :span="24"  style="text-align: right;padding-bottom: 20px;padding-top: 20px;">
                        <el-button @click="goBack">取消</el-button>
                        <el-button type="primary" @click="updateData">确定</el-button>
                    </el-col>
			     </el-row>
            </el-form>
        </div>
    </div>
[/#macro]

[#macro orderformUpdateConfig]
<script type="text/x-template" id="my-orderform-update">
    [@orderformUpdateView /]
</script>
<script type="text/javascript">
    //更新组件开始
    var orderformUpdateConfig = {};
    orderformUpdateConfig.template = "#my-orderform-update";
    orderformUpdateConfig.methods = config.basicMethod();
    orderformUpdateConfig.methods.updateData = function () {
        var self = this;
        this.$refs["ruleForm"].validate(function(valid){
            if (valid) {
                self.updateDataPost();
            } else {
                console.log('error submit!!');
                return false;
            }
        });
    }

    orderformUpdateConfig.methods.updateDataPost = function () {
        var self = this, data = this.form;
        //delete data.orderformCatalog;
        if (this.deforeUpdateData) {
            this.deforeUpdateData();
        }
        this.postData("${siteurl}tenantRest/orderform/update.htm", data, function (res) {
            if (res.code == 0) {
                self.$message({
                    message: '修改数据成功',
                    type: 'success'
                });
                //window.history.go(-1)
                self.$router.go(-1);
            } else {
                self.$message.error(res.msg);
            }
        });
    }
    orderformUpdateConfig.data = function () {
        return {
            form: {
                shop: '',
                no: '',
                mergeOrderCode: '',
                outTradeNum: '',
                orderSource: '',
                paySource: '',
                newRefundId: '',
                orderState: '',
                commentState: '',
                userState: '',
                orderTime: '',
                payTime: '',
                deliveryTime: '',
                receiveTime: '',
                orderType: '',
                weight: '',
                totalAmount: '',
                amount: '',
                changeAmount: '',
                payAmount: '',
                freight: '',
                discount: '',
                platformDiscount: '',
                integralDiscount: '',
                useIntegral: '',
                useRedPacket: '',
                redPacketDiscount: '',
                returnAmount: '',
                sendIntegral: '',
                sysReceiveTime: '',
                hasExtendReceive: '',
                editPriceTime: '',
                finishTime: '',
                productCount: '',
                returnCount: '',
                remindTime: '',
                consignee: '',
                phone: '',
                address: '',
                note: ''            },
            rules: {
            }
        }
    };

    orderformUpdateConfig.mounted = function () {
        var id = this.$route.query.id;
        var self = this;
        var data = {};
        data.id = id;
        this.postData("${siteurl}tenantRest/orderform/view.htm", data, function (res) {
            if (res.code == 0) {
                self.form = res;
            }
        });
    }
    orderformUpdateConfig.computed = {};
              orderformUpdateConfig.computed.shopOptions = function () {
                    return this.$store.state.shopOptions;
                };

    orderformUpdateConfig.destroyed = function () {
            console.log("destroyed add view ");
            
	}
    var orderformUpdateView = Vue.component('update-view', orderformUpdateConfig);
    //更新组件结束
</script>
[/#macro]